package list;

import java.util.LinkedList;

//双向链表实现，插入删除效率高，查找低
//线程不安全
public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<String> linkedList = new LinkedList<String>();
        linkedList.add("yu");
        linkedList.add("ming");
        linkedList.add("min");
        linkedList.add("yu1");
        System.out.println(linkedList);
        linkedList.addFirst("i am");
        System.out.println(linkedList);
        linkedList.addLast("hero");
        System.out.println(linkedList);
        linkedList.removeFirst();
        linkedList.removeLast();
        linkedList.getFirst();
        linkedList.getLast();

    }




}
